package com.edgclub.edg.activity;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.edgclub.edg.R;


public class SettingMessageInfoActivity extends GzBaseTooolBarActivity implements View.OnClickListener{

    private RelativeLayout all_people , my_people , my_friend;
    private ImageView all_people1 , my_people1 , my_friend1 ;
    @Override
    public int getContentView() {
        return R.layout.activity_message1;
    }

    @Override
    public void setTitleBarView() {
        setCustomActionBar();
        title.setText("新消息通知设置");
        main_back.setVisibility(View.VISIBLE);
        main_back.setOnClickListener(this);
    }

    @Override
    public void initView() {
        all_people = (RelativeLayout) findViewById(R.id.all_people);
        all_people.setOnClickListener(this);
        my_people = (RelativeLayout) findViewById(R.id.my_people);
        my_people.setOnClickListener(this);
        my_friend = (RelativeLayout) findViewById(R.id.my_friend);
        my_friend.setOnClickListener(this);
        all_people1 = (ImageView) findViewById(R.id.all_people1);
        my_people1 = (ImageView) findViewById(R.id.my_people1);
        my_friend1 = (ImageView) findViewById(R.id.my_friend1);
    }

    @Override
    public void initData() {
        String type = getIntent().getStringExtra("type");
        if (type.equals("0")){
            all_people1.setVisibility(View.VISIBLE);
            my_people1.setVisibility(View.GONE);
            my_friend1.setVisibility(View.GONE);
        }else if (type.equals("1")){
            all_people1.setVisibility(View.GONE);
            my_people1.setVisibility(View.VISIBLE);
            my_friend1.setVisibility(View.GONE);
        }else{
            all_people1.setVisibility(View.GONE);
            my_people1.setVisibility(View.GONE);
            my_friend1.setVisibility(View.VISIBLE);
        }

    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent(this,SettingMessageActivity.class);
        switch (v.getId()){
            case R.id.main_back:
                finish();
                break;
            case R.id.all_people:
                intent.putExtra("type" , "0");
                setResult(RESULT_OK, intent);
                finish();
                break;
            case R.id.my_people:
                intent.putExtra("type" , "1");
                setResult(RESULT_OK , intent);
                finish();
                break;
            case R.id.my_friend:
                intent.putExtra("type" , "2");
                setResult(RESULT_OK , intent);
                finish();
                break;
        }
    }

}
